import express, { Router } from 'express'
import * as avatarController from './avatar.controller'
import { authGuard } from '../auth/auth.middleware'
import { avatarInerceptor, avatarProcessor } from './avatar.middleware'

const router: Router = express.Router()

router.post(
  '/avatar',
  authGuard,
  avatarInerceptor,
  avatarProcessor,
  avatarController.store
)

router.get('/user/:userId/avatar', avatarController.serve)

export default router
